<!DOCTYPE html>
<html>
<head>
<title>用户商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">

<script type="text/javascript">
	var dataGrid;
	var val1 = true;
	var val2 = false;
	
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'list.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [
			{ field: 'id', title: '编号', width: 50, checkbox : false},
			{ field: 'userName', title: '用户名', width: 60, checkbox : false},
			{ field: 'borrowName', title: '标名称', width: 60, sortable: false},
			{ field: 'goodsName', title: '商品名称', width: 60, sortable: false },
			{ field: 'amount', title: '数量', width: 60, sortable: false},
//			{ field: 'status', title: '状态', width: 60, sortable: false,
//				formatter: function(value,row,index){
//					if (value==1){
//						return "待发货";
//					}else if(value==2){
//						return "已发货";
//					}else{
//						return "";
//					}
//				} },
			{ field: 'receiveInfo', title: '收货地址', width: 120, sortable: false },
			 ] ],
			toolbar : '#toolbar',
			onLoadSuccess : function() {
				$('#searchForm table').show();
				parent.$.messager.progress('close');
			}
		});
	});
	function exportExcel(){
		var url = "/modules/additional/enjoyUser/exportExcelList.html";
		var userName = $("#userName").val();
		var borrowName = $("#borrowName").val();
		var goodsName = $("#goodsName").val();
		var sou = "?userName=" + userName + "&borrowName=" + borrowName + "&goodsName=" + goodsName;
		window.location.href = url + sou;
	}
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text" name="searchName" id="searchName" class="sInput" placeholder="输入用户名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>用户名</span><input type="text" id="userName" name="userName" autocomplete="off"/></li>
					<li><span>标名称</span><input type="text" id="borrowName" name="borrowName" autocomplete="off"/></li>
					<li><span>商品名称</span><input type="text" id="goodsName" name="goodsName" autocomplete="off"/></li>
		        	<!--<li><span>状态</span><select id="status" name="status" class="type">-->
							<!--<option value="0">全部</option>-->
							<!--<option value="1">待发货</option>-->
							<!--<option value="2">已发货</option>-->
						<!--</select></li>-->
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
			<div class="sRight">
				<a onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>
			</div>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>